package org.dromara.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.dromara.business.domain.AppUser;
import org.dromara.business.domain.vo.AppUserVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;

import java.math.BigDecimal;

@Mapper
public interface AppUserMapper extends BaseMapperPlus<AppUser, AppUserVo> {
    /**
     * 增加用户总收益
     * @param userId 用户id
     * @param dailyRebate 收益
     */
    int increaseTotalEarnings(@Param("userId") Long userId, @Param("dailyRebate") BigDecimal dailyRebate);

    /**
     * 增加用户总质押金额
     * @param userId 用户ID
     * @param amount 金额
     */
    int increaseTotalStaked(@Param("userId") Long userId, @Param("amount") BigDecimal amount);
    /**
     * 扣除用户总质押金额
     * @param userId 用户ID
     * @param amount 金额
     */
    int deductTotalStaked(@Param("userId") Long userId, @Param("amount") BigDecimal amount);
}
